# -*- coding = utf-8 -*-
# @Time : 2021/11/27 13:53
# @Author : 龙王赘婿_彪少
# @File : yzw.py
# @Software: PyCharm

import re

class YZW:
    def __init__(self):
        self.datafile = "test.txt"
        self.date = []
        self.head = []
        self.answer = []

    def myread(self):
        f = open(self.datafile, "r")
        self.head = f.readline().split()
        print(self.head)
        print(len(self.head))
        print("-"*50)

        i = 0
        while True:
            self.date.append(f.readline().split())
            if self.date[i]:
                print("报头:", self.date[i][0], "长度:", len(self.date[i]), "编号:", i)
                print("数据:", self.date[i])
                print()
                i = i + 1
            else:
                break
        f.close()

    def analysis(self):
        pass


        # print(float(date[4]) + float(date[4]))

__name__ = "__main__"
yzw = YZW()
yzw.myread()
yzw.analysis()



# f = open("data.txt", "r")  # 设置文件对象
# line = f.readline()
# line = line[:-1]
# while line:  # 直到读取完文件
#     line = f.readline()  # 读取一行文件，包括换行符
# line = line[:-1]  # 去掉换行符，也可以不去
# f.close()  # 关闭文件